home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / Power.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  25.6 KB  |  687 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Power.h
  3.  
  4.      Contains:    Power Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc.  All rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __POWER__
  18. #define __POWER__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __MIXEDMODE__
  24. #include <MixedMode.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49.  
  50. enum {
  51.                                                                 /* Bit positions for ModemByte */
  52.     modemOnBit                    = 0,
  53.     ringWakeUpBit                = 2,
  54.     modemInstalledBit            = 3,
  55.     ringDetectBit                = 4,
  56.     modemOnHookBit                = 5
  57. };
  58.  
  59.  
  60. enum {
  61.                                                                 /* masks for ModemByte */
  62.     modemOnMask                    = 0x01,
  63.     ringWakeUpMask                = 0x04,
  64.     modemInstalledMask            = 0x08,
  65.     ringDetectMask                = 0x10,
  66.     modemOnHookMask                = 0x20
  67. };
  68.  
  69.  
  70. enum {
  71.                                                                 /* bit positions for BatteryByte */
  72.     chargerConnBit                = 0,
  73.     hiChargeBit                    = 1,
  74.     chargeOverFlowBit            = 2,
  75.     batteryDeadBit                = 3,
  76.     batteryLowBit                = 4,
  77.     connChangedBit                = 5
  78. };
  79.  
  80.  
  81. enum {
  82.                                                                 /* masks for BatteryByte */
  83.     chargerConnMask                = 0x01,
  84.     hiChargeMask                = 0x02,
  85.     chargeOverFlowMask            = 0x04,
  86.     batteryDeadMask                = 0x08,
  87.     batteryLowMask                = 0x10,
  88.     connChangedMask                = 0x20
  89. };
  90.  
  91.  
  92. enum {
  93.                                                                 /* bit positions for SoundMixerByte */
  94.     MediaBaySndEnBit            = 0,
  95.     PCISndEnBit                    = 1,
  96.     ZVSndEnBit                    = 2,
  97.     PCCardSndEnBit                = 3
  98. };
  99.  
  100.  
  101. enum {
  102.                                                                 /* masks for SoundMixerByte */
  103.     MediaBaySndEnMask            = 0x01,
  104.     PCISndEnMask                = 0x02,
  105.     ZVSndEnMask                    = 0x04,
  106.     PCCardSndEnMask                = 0x08
  107. };
  108.  
  109.  
  110. enum {
  111.                                                                 /* commands to SleepQRec sleepQProc */
  112.     sleepRequest                = 1,
  113.     sleepDemand                    = 2,
  114.     sleepWakeUp                    = 3,
  115.     sleepRevoke                    = 4,
  116.     sleepUnlock                    = 4,
  117.     sleepDeny                    = 5,
  118.     sleepNow                    = 6,
  119.     dozeDemand                    = 7,
  120.     dozeWakeUp                    = 8,
  121.     dozeRequest                    = 9
  122. };
  123.  
  124.  
  125. enum {
  126.                                                                 /* SleepQRec.sleepQFlags */
  127.     noCalls                        = 1,
  128.     noRequest                    = 2,
  129.     slpQType                    = 16,
  130.     sleepQType                    = 16
  131. };
  132.  
  133. /* bits in bitfield returned by PMFeatures */
  134.  
  135. enum {
  136.     hasWakeupTimer                = 0,                            /* 1=wakeup timer is supported                                */
  137.     hasSharedModemPort            = 1,                            /* 1=modem port shared by SCC and internal modem            */
  138.     hasProcessorCycling            = 2,                            /* 1=processor cycling is supported                            */
  139.     mustProcessorCycle            = 3,                            /* 1=processor cycling should not be turned off                */
  140.     hasReducedSpeed                = 4,                            /* 1=processor can be started up at reduced speed            */
  141.     dynamicSpeedChange            = 5,                            /* 1=processor speed can be switched dynamically            */
  142.     hasSCSIDiskMode                = 6,                            /* 1=SCSI Disk Mode is supported                            */
  143.     canGetBatteryTime            = 7,                            /* 1=battery time can be calculated                            */
  144.     canWakeupOnRing                = 8,                            /* 1=can wakeup when the modem detects a ring                */
  145.     hasDimmingSupport            = 9,                            /* 1=has dimming support built in (DPMS standby by default)    */
  146.     hasStartupTimer                = 10,                            /* 1=startup timer is supported                                */
  147.     hasChargeNotification        = 11,                            /* 1=client can determine of charge connect status change notifications available */
  148.     hasDimSuspendSupport        = 12                            /* 1=supports dimming LCD and CRT to DPMS suspend state        */
  149. };
  150.  
  151. /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */
  152.  
  153. enum {
  154.     hasInternalModem            = 0,                            /* 1=internal modem installed                        */
  155.     intModemRingDetect            = 1,                            /* 1=internal modem has detected a ring                */
  156.     intModemOffHook                = 2,                            /* 1=internal modem is off hook                        */
  157.     intModemRingWakeEnb            = 3,                            /* 1=wakeup on ring is enabled                        */
  158.     extModemSelected            = 4,                            /* 1=external modem selected                        */
  159.     modemSetBit                    = 15                            /* 1=set bit, 0=clear bit (SetIntModemState)        */
  160. };
  161.  
  162. /* bits in BatteryInfo.flags                                     */
  163. /* ("chargerConnected" doesn't mean the charger is plugged in)    */
  164.  
  165. enum {
  166.     batteryInstalled            = 7,                            /* 1=battery is currently connected                    */
  167.     batteryCharging                = 6,                            /* 1=battery is being charged                        */
  168.     chargerConnected            = 5                                /* 1=charger is connected to the PowerBook            */
  169. };
  170.  
  171.  
  172. enum {
  173.     HDPwrQType                    = 0x4844,                        /* 'HD' hard disk spindown queue element type        */
  174.     PMgrStateQType                = 0x504D                        /* 'PM' Power Manager state queue element type        */
  175. };
  176.  
  177. /* client notification bits in PMgrQueueElement.pmNotifyBits */
  178.  
  179. enum {
  180.     pmSleepTimeoutChanged        = 0,
  181.     pmSleepEnableChanged        = 1,
  182.     pmHardDiskTimeoutChanged    = 2,
  183.     pmHardDiskSpindownChanged    = 3,
  184.     pmDimmingTimeoutChanged        = 4,
  185.     pmDimmingEnableChanged        = 5,
  186.     pmDiskModeAddressChanged    = 6,
  187.     pmProcessorCyclingChanged    = 7,
  188.     pmProcessorSpeedChanged        = 8,
  189.     pmWakeupTimerChanged        = 9,
  190.     pmStartupTimerChanged        = 10,
  191.     pmHardDiskPowerRemovedbyUser = 11,
  192.     pmChargeStatusChanged        = 12,
  193.     pmPowerLevelChanged            = 13
  194. };
  195.  
  196. /* System Activity Selectors */
  197.  
  198. enum {
  199.     OverallAct                    = 0,                            /* general type of activity                            */
  200.     UsrActivity                    = 1,                            /* user specific type of activity                    */
  201.     NetActivity                    = 2,                            /* network specific activity                        */
  202.     HDActivity                    = 3                                /* Hard Drive activity                                */
  203. };
  204.  
  205. /* Storage Media sleep mode defines */
  206.  
  207. enum {
  208.     kMediaModeOn                = 0,                            /* Media active (Drive spinning and at full power)    */
  209.     kMediaModeStandBy            = 1,                            /* Media standby (not implemented)    */
  210.     kMediaModeSuspend            = 2,                            /* Media Idle (not implemented)    */
  211.     kMediaModeOff                = 3                                /* Media Sleep (Drive not spinning and at min power, max recovery time)    */
  212. };
  213.  
  214.  
  215. enum {
  216.     kMediaPowerCSCode            = 70
  217. };
  218.  
  219.  
  220. /* definitions for HDQueueElement.hdFlags    */
  221.  
  222. enum {
  223.     kHDQueuePostBit                = 0,                            /* 1 = call this routine on the second pass        */
  224.     kHDQueuePostMask            = (1 << kHDQueuePostBit)
  225. };
  226.  
  227.  
  228. struct ActivityInfo {
  229.     short                             ActivityType;                /* Type of activity to be fetched.  Same as UpdateSystemActivity Selectors */
  230.     unsigned long                     ActivityTime;                /* Time of last activity (in ticks) of specified type. */
  231. };
  232. typedef struct ActivityInfo                ActivityInfo;
  233. /* information returned by GetScaledBatteryInfo */
  234.  
  235. struct BatteryInfo {
  236.     UInt8                             flags;                        /* misc flags (see below)                            */
  237.     UInt8                             warningLevel;                /* scaled warning level (0-255)                        */
  238.     UInt8                             reserved;                    /* reserved for internal use                        */
  239.     UInt8                             batteryLevel;                /* scaled battery level (0-255)                        */
  240. };
  241. typedef struct BatteryInfo                BatteryInfo;
  242.  
  243. typedef SInt8                             ModemByte;
  244. typedef SInt8                             BatteryByte;
  245. typedef SInt8                             SoundMixerByte;
  246. typedef long                             PMResultCode;
  247. typedef struct SleepQRec                 SleepQRec;
  248. typedef SleepQRec *                        SleepQRecPtr;
  249. typedef struct HDQueueElement             HDQueueElement;
  250. typedef struct PMgrQueueElement         PMgrQueueElement;
  251. typedef CALLBACK_API( long , SleepQProcPtr )(long message, SleepQRecPtr qRecPtr);
  252. /*
  253.     WARNING: SleepQProcPtr uses register based parameters under classic 68k
  254.              and cannot be written in a high-level language without 
  255.              the help of mixed mode or assembly glue.
  256. */
  257. typedef CALLBACK_API( void , HDSpindownProcPtr )(HDQueueElement *theElement);
  258. typedef CALLBACK_API( void , PMgrStateChangeProcPtr )(PMgrQueueElement *theElement, long stateBits);
  259. typedef REGISTER_UPP_TYPE(SleepQProcPtr)                         SleepQUPP;
  260. typedef STACK_UPP_TYPE(HDSpindownProcPtr)                         HDSpindownUPP;
  261. typedef STACK_UPP_TYPE(PMgrStateChangeProcPtr)                     PMgrStateChangeUPP;
  262.  
  263. struct SleepQRec {
  264.     SleepQRecPtr                     sleepQLink;                    /* pointer to next queue element                */
  265.     short                             sleepQType;                    /* queue element type (must be SleepQType)        */
  266.     SleepQUPP                         sleepQProc;                    /* pointer to sleep universal proc ptr            */
  267.     short                             sleepQFlags;                /* flags                                        */
  268. };
  269.  
  270.  
  271. struct HDQueueElement {
  272.     struct HDQueueElement *            hdQLink;                    /* pointer to next queue element                */
  273.     short                             hdQType;                    /* queue element type (must be HDPwrQType)        */
  274.     short                             hdFlags;                    /* miscellaneous flags                            */
  275.     HDSpindownUPP                     hdProc;                        /* pointer to routine to call                    */
  276.     long                             hdUser;                        /* user-defined (variable storage, etc.)        */
  277. };
  278.  
  279.  
  280. struct PMgrQueueElement {
  281.     struct PMgrQueueElement *        pmQLink;                    /* pointer to next queue element                */
  282.     short                             pmQType;                    /* queue element type (must be PMgrStateQType)    */
  283.     short                             pmFlags;                    /* miscellaneous flags                            */
  284.     long                             pmNotifyBits;                /* bitmap of which changes to be notified for    */
  285.     PMgrStateChangeUPP                 pmProc;                        /* pointer to routine to call                    */
  286.     long                             pmUser;                        /* user-defined (variable storage, etc.)        */
  287. };
  288.  
  289.  
  290.  
  291. struct BatteryTimeRec {
  292.     unsigned long                     expectedBatteryTime;        /* estimated battery time remaining (seconds)    */
  293.     unsigned long                     minimumBatteryTime;            /* minimum battery time remaining (seconds)        */
  294.     unsigned long                     maximumBatteryTime;            /* maximum battery time remaining (seconds)        */
  295.     unsigned long                     timeUntilCharged;            /* time until battery is fully charged (seconds)*/
  296. };
  297. typedef struct BatteryTimeRec            BatteryTimeRec;
  298.  
  299.  
  300. struct WakeupTime {
  301.     unsigned long                     wakeTime;                    /* wakeup time (same format as current time)        */
  302.     Boolean                         wakeEnabled;                /* 1=enable wakeup timer, 0=disable wakeup timer    */
  303.     SInt8                             filler;
  304. };
  305. typedef struct WakeupTime                WakeupTime;
  306.  
  307.  
  308. struct StartupTime {
  309.     unsigned long                     startTime;                    /* startup time (same format as current time)        */
  310.     Boolean                         startEnabled;                /* 1=enable startup timer, 0=disable startup timer    */
  311.     SInt8                             filler;
  312. };
  313. typedef struct StartupTime                StartupTime;
  314. EXTERN_API( OSErr )
  315. DisableWUTime                    (void);
  316.  
  317. EXTERN_API( OSErr )
  318. SetWUTime                        (long                     WUTime);
  319.  
  320. EXTERN_API( OSErr )
  321. GetWUTime                        (long *                    WUTime,
  322.                                  Byte *                    WUFlag);
  323.  
  324. EXTERN_API( OSErr )
  325. BatteryStatus                    (Byte *                    Status,
  326.                                  Byte *                    Power);
  327.  
  328. EXTERN_API( OSErr )
  329. ModemStatus                        (Byte *                    Status);
  330.  
  331.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  332.                                                                                             #pragma parameter __D0 IdleUpdate
  333.                                                                                             #endif
  334. EXTERN_API( long )
  335. IdleUpdate                        (void)                                                        ONEWORDINLINE(0xA285);
  336.  
  337.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  338.                                                                                             #pragma parameter __D0 GetCPUSpeed
  339.                                                                                             #endif
  340. EXTERN_API( long )
  341. GetCPUSpeed                        (void)                                                        TWOWORDINLINE(0x70FF, 0xA485);
  342.  
  343. EXTERN_API( void )
  344. EnableIdle                        (void)                                                        TWOWORDINLINE(0x7000, 0xA485);
  345.  
  346. EXTERN_API( void )
  347. DisableIdle                        (void)                                                        TWOWORDINLINE(0x7001, 0xA485);
  348.  
  349.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  350.                                                                                             #pragma parameter SleepQInstall(__A0)
  351.                                                                                             #endif
  352. EXTERN_API( void )
  353. SleepQInstall                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA28A);
  354.  
  355.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  356.                                                                                             #pragma parameter SleepQRemove(__A0)
  357.                                                                                             #endif
  358. EXTERN_API( void )
  359. SleepQRemove                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA48A);
  360.  
  361. EXTERN_API( void )
  362. AOn                                (void)                                                        TWOWORDINLINE(0x7004, 0xA685);
  363.  
  364. EXTERN_API( void )
  365. AOnIgnoreModem                    (void)                                                        TWOWORDINLINE(0x7005, 0xA685);
  366.  
  367. EXTERN_API( void )
  368. BOn                                (void)                                                        TWOWORDINLINE(0x7000, 0xA685);
  369.  
  370. EXTERN_API( void )
  371. AOff                            (void)                                                        TWOWORDINLINE(0x7084, 0xA685);
  372.  
  373. EXTERN_API( void )
  374. BOff                            (void)                                                        TWOWORDINLINE(0x7080, 0xA685);
  375.  
  376.  
  377. /* Public Power Management API (NEW!) */
  378.  
  379.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  380.                                                                                             #pragma parameter __D0 PMSelectorCount
  381.                                                                                             #endif
  382. EXTERN_API( short )
  383. PMSelectorCount                    (void)                                                        TWOWORDINLINE(0x7000, 0xA09E);
  384.  
  385.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  386.                                                                                             #pragma parameter __D0 PMFeatures
  387.                                                                                             #endif
  388. EXTERN_API( unsigned long )
  389. PMFeatures                        (void)                                                        TWOWORDINLINE(0x7001, 0xA09E);
  390.  
  391.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  392.                                                                                             #pragma parameter __D0 GetSleepTimeout
  393.                                                                                             #endif
  394. EXTERN_API( UInt8 )
  395. GetSleepTimeout                    (void)                                                        TWOWORDINLINE(0x7002, 0xA09E);
  396.  
  397.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  398.                                                                                             #pragma parameter SetSleepTimeout(__D0)
  399.                                                                                             #endif
  400. EXTERN_API( void )
  401. SetSleepTimeout                    (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0003, 0xA09E);
  402.  
  403.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  404.                                                                                             #pragma parameter __D0 GetHardDiskTimeout
  405.                                                                                             #endif
  406. EXTERN_API( UInt8 )
  407. GetHardDiskTimeout                (void)                                                        TWOWORDINLINE(0x7004, 0xA09E);
  408.  
  409.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  410.                                                                                             #pragma parameter SetHardDiskTimeout(__D0)
  411.                                                                                             #endif
  412. EXTERN_API( void )
  413. SetHardDiskTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0005, 0xA09E);
  414.  
  415.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  416.                                                                                             #pragma parameter __D0 HardDiskPowered
  417.                                                                                             #endif
  418. EXTERN_API( Boolean )
  419. HardDiskPowered                    (void)                                                        TWOWORDINLINE(0x7006, 0xA09E);
  420.  
  421.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  422.                                                                                             #pragma parameter SpinDownHardDisk
  423.                                                                                             #endif
  424. EXTERN_API( void )
  425. SpinDownHardDisk                (void)                                                        TWOWORDINLINE(0x7007, 0xA09E);
  426.  
  427.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  428.                                                                                             #pragma parameter __D0 IsSpindownDisabled
  429.                                                                                             #endif
  430. EXTERN_API( Boolean )
  431. IsSpindownDisabled                (void)                                                        TWOWORDINLINE(0x7008, 0xA09E);
  432.  
  433.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  434.                                                                                             #pragma parameter SetSpindownDisable(__D0)
  435.                                                                                             #endif
  436. EXTERN_API( void )
  437. SetSpindownDisable                (Boolean                 setDisable)                            FOURWORDINLINE(0x4840, 0x303C, 0x0009, 0xA09E);
  438.  
  439.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  440.                                                                                             #pragma parameter __D0 HardDiskQInstall(__A0)
  441.                                                                                             #endif
  442. EXTERN_API( OSErr )
  443. HardDiskQInstall                (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700A, 0xA09E);
  444.  
  445.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  446.                                                                                             #pragma parameter __D0 HardDiskQRemove(__A0)
  447.                                                                                             #endif
  448. EXTERN_API( OSErr )
  449. HardDiskQRemove                    (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700B, 0xA09E);
  450.  
  451.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  452.                                                                                             #pragma parameter GetScaledBatteryInfo(__D0, __A0)
  453.                                                                                             #endif
  454. EXTERN_API( void )
  455. GetScaledBatteryInfo            (short                     whichBattery,
  456.                                  BatteryInfo *            theInfo)                            FIVEWORDINLINE(0x4840, 0x303C, 0x000C, 0xA09E, 0x2080);
  457.  
  458.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  459.                                                                                             #pragma parameter AutoSleepControl(__D0)
  460.                                                                                             #endif
  461. EXTERN_API( void )
  462. AutoSleepControl                (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x000D, 0xA09E);
  463.  
  464.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  465.                                                                                             #pragma parameter __D0 GetIntModemInfo
  466.                                                                                             #endif
  467. EXTERN_API( unsigned long )
  468. GetIntModemInfo                    (void)                                                        TWOWORDINLINE(0x700E, 0xA09E);
  469.  
  470.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  471.                                                                                             #pragma parameter SetIntModemState(__D0)
  472.                                                                                             #endif
  473. EXTERN_API( void )
  474. SetIntModemState                (short                     theState)                            FOURWORDINLINE(0x4840, 0x303C, 0x000F, 0xA09E);
  475.  
  476.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  477.                                                                                             #pragma parameter __D0 MaximumProcessorSpeed
  478.                                                                                             #endif
  479. EXTERN_API( short )
  480. MaximumProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7010, 0xA09E);
  481.  
  482.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  483.                                                                                             #pragma parameter __D0 CurrentProcessorSpeed
  484.                                                                                             #endif
  485. EXTERN_API( short )
  486. CurrentProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7011, 0xA09E);
  487.  
  488.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  489.                                                                                             #pragma parameter __D0 FullProcessorSpeed
  490.                                                                                             #endif
  491. EXTERN_API( Boolean )
  492. FullProcessorSpeed                (void)                                                        TWOWORDINLINE(0x7012, 0xA09E);
  493.  
  494.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  495.                                                                                             #pragma parameter __D0 SetProcessorSpeed(__D0)
  496.                                                                                             #endif
  497. EXTERN_API( Boolean )
  498. SetProcessorSpeed                (Boolean                 fullSpeed)                            FOURWORDINLINE(0x4840, 0x303C, 0x0013, 0xA09E);
  499.  
  500.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  501.                                                                                             #pragma parameter __D0 GetSCSIDiskModeAddress
  502.                                                                                             #endif
  503. EXTERN_API( short )
  504. GetSCSIDiskModeAddress            (void)                                                        TWOWORDINLINE(0x7014, 0xA09E);
  505.  
  506.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  507.                                                                                             #pragma parameter SetSCSIDiskModeAddress(__D0)
  508.                                                                                             #endif
  509. EXTERN_API( void )
  510. SetSCSIDiskModeAddress            (short                     scsiAddress)                        FOURWORDINLINE(0x4840, 0x303C, 0x0015, 0xA09E);
  511.  
  512.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  513.                                                                                             #pragma parameter GetWakeupTimer(__A0)
  514.                                                                                             #endif
  515. EXTERN_API( void )
  516. GetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7016, 0xA09E);
  517.  
  518.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  519.                                                                                             #pragma parameter SetWakeupTimer(__A0)
  520.                                                                                             #endif
  521. EXTERN_API( void )
  522. SetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7017, 0xA09E);
  523.  
  524.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  525.                                                                                             #pragma parameter __D0 IsProcessorCyclingEnabled
  526.                                                                                             #endif
  527. EXTERN_API( Boolean )
  528. IsProcessorCyclingEnabled        (void)                                                        TWOWORDINLINE(0x7018, 0xA09E);
  529.  
  530.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  531.                                                                                             #pragma parameter EnableProcessorCycling(__D0)
  532.                                                                                             #endif
  533. EXTERN_API( void )
  534. EnableProcessorCycling            (Boolean                 enable)                                FOURWORDINLINE(0x4840, 0x303C, 0x0019, 0xA09E);
  535.  
  536.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  537.                                                                                             #pragma parameter __D0 BatteryCount
  538.                                                                                             #endif
  539. EXTERN_API( short )
  540. BatteryCount                    (void)                                                        TWOWORDINLINE(0x701A, 0xA09E);
  541.  
  542.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  543.                                                                                             #pragma parameter __D0 GetBatteryVoltage(__D0)
  544.                                                                                             #endif
  545. EXTERN_API( Fixed )
  546. GetBatteryVoltage                (short                     whichBattery)                        FOURWORDINLINE(0x4840, 0x303C, 0x001B, 0xA09E);
  547.  
  548.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  549.                                                                                             #pragma parameter GetBatteryTimes(__D0, __A0)
  550.                                                                                             #endif
  551. EXTERN_API( void )
  552. GetBatteryTimes                    (short                     whichBattery,
  553.                                  BatteryTimeRec *        theTimes)                            FOURWORDINLINE(0x4840, 0x303C, 0x001C, 0xA09E);
  554.  
  555.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  556.                                                                                             #pragma parameter __D0 GetDimmingTimeout
  557.                                                                                             #endif
  558. EXTERN_API( UInt8 )
  559. GetDimmingTimeout                (void)                                                        TWOWORDINLINE(0x701D, 0xA09E);
  560.  
  561.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  562.                                                                                             #pragma parameter SetDimmingTimeout(__D0)
  563.                                                                                             #endif
  564. EXTERN_API( void )
  565. SetDimmingTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x001E, 0xA09E);
  566.  
  567.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  568.                                                                                             #pragma parameter DimmingControl(__D0)
  569.                                                                                             #endif
  570. EXTERN_API( void )
  571. DimmingControl                    (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x001F, 0xA09E);
  572.  
  573.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  574.                                                                                             #pragma parameter __D0 IsDimmingControlDisabled
  575.                                                                                             #endif
  576. EXTERN_API( Boolean )
  577. IsDimmingControlDisabled        (void)                                                        TWOWORDINLINE(0x7020, 0xA09E);
  578.  
  579.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  580.                                                                                             #pragma parameter __D0 IsAutoSlpControlDisabled
  581.                                                                                             #endif
  582. EXTERN_API( Boolean )
  583. IsAutoSlpControlDisabled        (void)                                                        TWOWORDINLINE(0x7021, 0xA09E);
  584.  
  585.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  586.                                                                                             #pragma parameter __D0 PMgrStateQInstall(__A0)
  587.                                                                                             #endif
  588. EXTERN_API( OSErr )
  589. PMgrStateQInstall                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7022, 0xA09E);
  590.  
  591.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  592.                                                                                             #pragma parameter __D0 PMgrStateQRemove(__A0)
  593.                                                                                             #endif
  594. EXTERN_API( OSErr )
  595. PMgrStateQRemove                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7023, 0xA09E);
  596.  
  597.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  598.                                                                                             #pragma parameter __D0 UpdateSystemActivity(__D0)
  599.                                                                                             #endif
  600. EXTERN_API( OSErr )
  601. UpdateSystemActivity            (UInt8                     activity)                            FOURWORDINLINE(0x4840, 0x303C, 0x0024, 0xA09E);
  602.  
  603.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  604.                                                                                             #pragma parameter __D0 DelaySystemIdle
  605.                                                                                             #endif
  606. EXTERN_API( OSErr )
  607. DelaySystemIdle                    (void)                                                        TWOWORDINLINE(0x7025, 0xA09E);
  608.  
  609.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  610.                                                                                             #pragma parameter __D0 GetStartupTimer(__A0)
  611.                                                                                             #endif
  612. EXTERN_API( OSErr )
  613. GetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7026, 0xA09E);
  614.  
  615.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  616.                                                                                             #pragma parameter __D0 SetStartupTimer(__A0)
  617.                                                                                             #endif
  618. EXTERN_API( OSErr )
  619. SetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7027, 0xA09E);
  620.  
  621.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  622.                                                                                             #pragma parameter __D0 GetLastActivity(__A0)
  623.                                                                                             #endif
  624. EXTERN_API( OSErr )
  625. GetLastActivity                    (ActivityInfo *            theActivity)                        TWOWORDINLINE(0x7028, 0xA09E);
  626.  
  627.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  628.                                                                                             #pragma parameter __D0 GetSoundMixerState(__A0)
  629.                                                                                             #endif
  630. EXTERN_API( OSErr )
  631. GetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x7029, 0xA09E);
  632.  
  633.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  634.                                                                                             #pragma parameter __D0 SetSoundMixerState(__A0)
  635.                                                                                             #endif
  636. EXTERN_API( OSErr )
  637. SetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x702A, 0xA09E);
  638.  
  639.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  640.                                                                                             #pragma parameter __D0 GetDimSuspendState
  641.                                                                                             #endif
  642. EXTERN_API( Boolean )
  643. GetDimSuspendState                (void)                                                        TWOWORDINLINE(0x702B, 0xA09E);
  644.  
  645.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  646.                                                                                             #pragma parameter SetDimSuspendState(__D0)
  647.                                                                                             #endif
  648. EXTERN_API( void )
  649. SetDimSuspendState                (Boolean                 dimSuspendState)                    FOURWORDINLINE(0x4840, 0x303C, 0x002C, 0xA09E);
  650.  
  651. enum { uppSleepQProcInfo = 0x00131832 };                         /* register 4_bytes:D0 Func(4_bytes:D0, 4_bytes:A0) */
  652. enum { uppHDSpindownProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  653. enum { uppPMgrStateChangeProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  654. #define NewSleepQProc(userRoutine)                                 (SleepQUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentArchitecture())
  655. #define NewHDSpindownProc(userRoutine)                             (HDSpindownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHDSpindownProcInfo, GetCurrentArchitecture())
  656. #define NewPMgrStateChangeProc(userRoutine)                     (PMgrStateChangeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPMgrStateChangeProcInfo, GetCurrentArchitecture())
  657. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  658.     #pragma parameter __D0 CallSleepQProc(__A1, __D0, __A0)
  659.     long CallSleepQProc(SleepQUPP routine, long message, SleepQRecPtr qRecPtr) = 0x4E91;
  660. #else
  661.     #define CallSleepQProc(userRoutine, message, qRecPtr)         CALL_TWO_PARAMETER_UPP((userRoutine), uppSleepQProcInfo, (message), (qRecPtr))
  662. #endif
  663. #define CallHDSpindownProc(userRoutine, theElement)             CALL_ONE_PARAMETER_UPP((userRoutine), uppHDSpindownProcInfo, (theElement))
  664. #define CallPMgrStateChangeProc(userRoutine, theElement, stateBits)  CALL_TWO_PARAMETER_UPP((userRoutine), uppPMgrStateChangeProcInfo, (theElement), (stateBits))
  665.  
  666.  
  667. #if PRAGMA_STRUCT_ALIGN
  668.     #pragma options align=reset
  669. #elif PRAGMA_STRUCT_PACKPUSH
  670.     #pragma pack(pop)
  671. #elif PRAGMA_STRUCT_PACK
  672.     #pragma pack()
  673. #endif
  674.  
  675. #ifdef PRAGMA_IMPORT_OFF
  676. #pragma import off
  677. #elif PRAGMA_IMPORT
  678. #pragma import reset
  679. #endif
  680.  
  681. #ifdef __cplusplus
  682. }
  683. #endif
  684.  
  685. #endif /* __POWER__ */
  686.  
  687.